#设置cmake最低版本
cmake_minimum_required(VERSION 3.4.1)

#设置项目名称
project(tst_qtserialbus_auto)

#引入add_module模板文件
include(${ISSQTTESTROOTDIR}/cmake/add_module.cmake)

#设置测试类型，auto为自动测试，manual为手动测试,即test目录下的文件夹名
set(TEST_TYPE auto)
#设置模块名
set(MODULE qtserialbus)
#设置需要链接的模块
set(LinkQt Core Widgets SerialBus Network SerialPort)
#设置需要链接的模块的私有模块
set(LinkQtPrivate Core SerialBus)
#设置排除的文件夹
set(EXCLUDE domain qml-qtquicktest)

#多级目录
 set(TEST_ITEMS ${TEST_ITEMS}
      qcanbusframe
      qcanbusdevice
      qmodbusdataunit
      qmodbusreply
      qmodbusdevice
      qmodbuspdu
      qmodbusserver
      qmodbusadu
      qmodbusdeviceidentification
      qmodbusrtuserialmaster
  )
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Android")
        list(APPEND TEST_ITEMS
            qcanbus
        )
endif()

message(Qt${QT_VERSION_MAJOR}SerialBusPrivate_DIR=${Qt${QT_VERSION_MAJOR}SerialBusPrivate_DIR})

if(DEFINED Qt${QT_VERSION_MAJOR}SerialBusPrivate_DIR AND NOT "${Qt${QT_VERSION_MAJOR}SerialBusPrivate_DIR}" STREQUAL "")
    # Private Test
    list(APPEND TEST_ITEMS
        qmodbuscommevent
        qmodbusclient
    )
else()
    # set(EXCLUDE_SRC ${EXCLUDE_SRC}
    #      core/common/qbackendnodetester.cpp
    #      core/common/qbackendnodetester.h
    #  )
endif()


set(PLUGINS QOpenHarmonyPlatformIntegrationPlugin)

if(DEFINED TEST_ITEMS)
    create_library(${TEST_ITEMS})
endif()

